﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.BizTalk.TestTools.Schema;

namespace Acme.BizTalk.Schemas.Tests
{
    /// <summary>
    /// Tests the claims schemas
    /// </summary>
    [TestClass]
    public class ClaimsTest
    {
        /// <summary>
        /// Tests the format of a standard batch
        /// </summary>
        [TestMethod]
        public void StandardBatch()
        {            
            TestableSchemaBase schema = new Claims.ClaimsBatch();
            bool result = schema.ValidateInstance(@"..\..\..\Acme.BizTalk.Schemas.Tests\NormalClaimsBatch.xml", OutputInstanceType.XML);
            Assert.IsTrue(result, "The schema failed validation");            
        }
        /// <summary>
        /// Tests the regular expression for the amount
        /// </summary>
        [TestMethod]
        public void TestDecimalRegEx()
        {
            TestableSchemaBase schema = new Claims.ClaimsBatch();
            bool result = schema.ValidateInstance(@"..\..\..\Acme.BizTalk.Schemas.Tests\InvalidAmount.xml", OutputInstanceType.XML);
            Assert.IsFalse(result, "The should have schema failed validation");
        }
    }
}
